﻿using RpcCentral.Model.DB;
using SqlSugarHelper;

namespace RpcCentral.DAL.Repository
{
    internal class ServiceVerConfigDAL : IServiceVerConfigDAL
    {
        private IRepository<ServiceVerConfig> _Db;
        public ServiceVerConfigDAL(IRepository<ServiceVerConfig> db)
        {
            _Db = db;
        }

        public long GetVerId(long ver, long systemTypeId, long rpcMerId)
        {
            return this._Db.Get(a => a.RpcMerId == rpcMerId && a.VerNum == ver && a.SystemTypeId == systemTypeId && a.IsEnable, a => a.Id);
        }
    }
}
